home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4879 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: freenet2.freenet.ufl.edu!afn03257
  2. From: afn03257@freenet2.freenet.ufl.edu (Daniel P Hudson)
  3. Newsgroups: comp.os.msdos.programmer,comp.lang.c
  4. Subject: Re: open vs fopen?
  5. Date: 7 Feb 1996 18:09:37 GMT
  6. Message-ID: <4fapt1$qmp@huron.eel.ufl.edu>
  7. References: <uEYFxc9nX8WX083yn@mbnet.mb.ca>
  8.  <4f8qbg$549@chleuasme.francenet.fr>
  9. NNTP-Posting-Host: freenet2.afn.org
  10. X-Newsreader: wsOMR/SOUP v1.00 [NR]
  11.  
  12. In article <4f8qbg$549@chleuasme.francenet.fr>,
  13. sherlock@micronet.fr wrote:
  14.  
  15.  > natewild@mbnet.mb.ca (Nathan T. Wild) wrote:
  16.  
  17.  > >In C, why would one use open and DOS int handles rather than fopen and
  18.  > >stdio file handles?
  19.  
  20.  > because files opened using open and DOS files handles can be read and
  21.  > write at the same time, while stdio files can't.
  22.  
  23.  Huh? Run that by me again. fopen can open a file for both
  24.  read and write access or just read or just write access.
  25.  
  26.  DOS has nothing to do with permitting read, write, or read/write access,
  27.  that is dependant on the hardware only. Using _dos_open
  28.  returns the dos file handle which can be used with DOS interrupt services,
  29.  this permits you to truncate a file if you wish. FILE is a
  30.  structure about the file it is associated with and the buffer it uses.
  31.  DOS doesn't give buffer info even if your using a buffer.
  32.  
  33.  > suppose you have a database file, with fixed length fields.
  34.  > low level functions(open...) enable the writing of some records and
  35.  > the reading of other without closing the file.
  36.  
  37.  suppose you just use "r+" for the access specifier with fopen().
  38.  
  39.  
  40.  
  41.